﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        CGeneral.CheckLogin(Request, Session);
    }

    public void UserLogin_Click(object sender, EventArgs e)
    {
        members m = Check.LoginCheck(Request.Form["username"], Request.Form["password"]);
        if (m != null)
        {
            if (m.gid == 4)
                CGeneral.GoToErrorPage(Response, "custom", "该用户已被和谐");
            Session["username"] = m.username;
            Session["uid"] = m.uid;
            Session["gid"] = m.gid;
            Session["nickname"] = m.nickname;
            Response.Redirect("Index.aspx");
        }
        else
        {

            CGeneral.GoToErrorPage(Response, "WrongPassword");
        }

    }
}